﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KingOfCSharp.iHunter.Plugins.BBS
{
    /// <summary>
    /// Args to DataReceived Event
    /// </summary>
    public class DataReceivedEventArgs : EventArgs
    {
        /// <summary>
        /// The data received
        /// </summary>
        public byte[] Data
        {
            get;
            private set;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="data">Data received</param>
        public DataReceivedEventArgs(byte[] data)
        {
            Data = data;
        }
    }

    public class ItemDownloadedEventArgs : EventArgs
    {
        public object Item
        {
            get;
            private set;
        }

        public ItemDownloadedEventArgs(object msg)
        {
            this.Item = msg;
        }
    }

    public class TaskCompletedEventArgs : EventArgs
    {
        public bool Success
        {
            get;
            private set;
        }

        public object Result
        {
            get;
            private set;
        }

        public Task Task
        {
            get;
            private set;
        }

        public Exception Error
        {
            get;
            private set;
        }

		public bool Retry
		{
			get;
			set;
		}

        public TaskCompletedEventArgs(Task task, bool success, Exception err, object result, bool retry)
        {
            this.Task = task;
            this.Success = success;
            this.Error = err;
            this.Result = result;
			this.Retry = retry;
        }
    }
}
